<?php
/**
 * Created by PhpStorm.
 * User: Tangyijun
 * Date: 2017/3/21
 * Time: 11:53
 */
namespace app\home\validate;
use think\Validate;
class User extends Validate{
    protected $rule = [
        'password' => 'require',
        'repassword' => 'require|confirm:password',
    ];
    //定义错误信息
    protected $message = [
        'password.require'    =>  '密码不能为空',
        'repassword.confirm' =>  '2次输入的密码不正确',
    ];
    //验证场景
    protected $scene = [
        'forgetPassword'  =>  ['password','repassword'],
    ];
}